<?php

namespace App\Models;

use App\Traits\HasDateTimeFormatter;
use App\Traits\HasOrgCode;
use App\Traits\HasOrgRoot;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Org extends Model
{
    use HasFactory, HasOrgCode, HasOrgRoot, HasDateTimeFormatter;

    protected $table = "org";

    protected $hidden = ["created_at", "updated_at"];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function menus()
    {
        return $this->belongsToMany(Menu::class, 'org_menu');
    }
}
